import request from '@/utils/request'

// 创建通知公告
export function createSystem(data) {
  return request({
    url: '/system/notice/create',
    method: 'post',
    data: data
  })
}

// 更新通知公告
export function updateSystem(data) {
  return request({
    url: '/system/notice/update',
    method: 'put',
    data: data
  })
}

// 删除通知公告
export function deleteSystem(id) {
  return request({
    url: '/system/notice/delete?id=' + id,
    method: 'delete'
  })
}

// 获得通知公告
export function getSystem(id) {
  return request({
    url: '/system/notice/get?id=' + id,
    method: 'get'
  })
}

// 获得通知公告分页
export function getSystemPage(params) {
  return request({
    url: '/system/notice/page',
    method: 'get',
    params
  })
}
// 导出通知公告 Excel
export function exportSystemExcel(params) {
  return request({
    url: '/system/notice/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

//存入草稿箱
export function draftSystem(data) {
  return request({
    url: '/notice/system/draft',
    method: 'post',
    data: data
  })
}

//公告首页展示接口
export function getNoticeList() {
  return request({
    url: '/system/notice/first-created',
    method: 'get'
  })
}

export function getVisitCount() {
  return request({
    url: '/system/user/getcount',
    method: 'get'
  })
}